﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FunctionalCLR.Core {
    public class SinNode : FuncNode {
        public SinNode()
            : base() {
            base.Value = "sin";
            this.ParameterCount = 1;
        }

        public override object Accept(IVisitor visitor) {
            return visitor.Visit(this);
        }

        public override FuncNode GetReversedFunction(int index) {
            return new AsinNode();
        }

        public override object Evaluate() {
            double[] results = base.EvaluateChildren();

            return Math.Sin(results[0]).ToString();
        }
    }
}
